1. Field of the Invention
The present invention relates to an image processing device based on a computer, and more particularly, to an image processing device whereby the process of generating colour data for frames comprising a plurality of polygons can be conducted efficiently in a short period of time, or this process can be conducted efficiently in a short period of time using a small hardware composition, and it relates to a method for same and a storage medium for storing image processing programs for same.
2. Description of the Related Art
Image processing technology based on computers is used in simulation devices and game devices. Normally, data for polygons to be drawn on a screen and colour data for each pixel in these polygons are determined from image data generated by the simulation or game sequence program, and this colour data is stored in a frame buffer memory corresponding to the screen pixels. An image is then displayed on a display device, such as a CRT, or the like, in accordance with the colour data in the frame buffer memory.
The process of determining the aforementioned polygon data is usually carried out by a geometry processing section, and the process of determining colour data for each pixel is generally conducted by a rendering processing section.
The polygon data produced by the geometry processing section generally comprises vertex data. The colour data for pixels in a polygon is determined by interpolation of the parameter values contained in the vertex data.
However, in some cases, a frame may contain a plurality of polygons which overlap with each other, and in this event, only the portions of polygons which are foremost in the screen are displayed, whilst the portions of polygons which are covered by another polygon are not displayed. Therefore, conventionally, a Z-value buffer memory corresponding to the pixels in each frame is provided, and when the colour data for a pixel is written into the frame buffer memory, the Z-value for that pixel is written into a region of the Z-value buffer memory corresponding to the pixel. The operation of deciding whether or not a pixel in a polygon processed subsequently is positioned in front of a pixel already written to the memory is carried out by comparing their respective Z values. Alternatively, as a further algorithm, the colour data may always be written to the frame buffer starting from the polygon which is rearmost in the frame. The Z-value described above means depth value indicating a depth in a screen. For the convenience, the depth value is referred to z-value here in after.
However, when a plurality of polygons overlap with each other, it may occur that, after colour data for a pixel positioned to the rear of the frame has been calculated and colour data for that pixel has been written to the frame buffer memory, colour data for a pixel in a different polygon, positioned in front of the aforementioned pixel, is calculated and this colour data is written to the same address in the frame buffer memory. Therefore, the rendering process for the pixel positioned to the rear, which has already been carried out, becomes completely purposeless, thus causing the efficiency of the rendering process to decline.
Furthermore, in a conventional method, the rendering process for a particular pixel in a particular polygon is conducted simultaneously with the interpolation of parameters in the vertex data and the interpolation of Z values. Therefore, the hardware composition for this section becomes very large. Consequently, if it is sought to process a plurality of these sections in parallel, the hardware will become colossal, which will be impractical. This is one factor which restricts improvements in the efficiency of rendering.